1. Field of Invention
The present invention relates to a focus detecting method, a focus detecting mechanism, and an image measuring device having focus detecting mechanism.
2. Description of Related Art
JP-A-8-226805 discloses a focusing (focus detecting) method for adjusting the optical distance from a workpiece to an image pickup means in an image measuring device (non-contact measuring device) having the image pickup means for picking-up the image of a measured object (workpiece), and measuring the shape, size, etc. of the workpiece by suitably processing the image picked up by this image pickup means.
The image measuring device described in JP-A-8-226805 has a CCD camera as the image pickup means for picking-up the image of the workpiece and outputting its image data, a focusing adjusting means for adjusting the optical distance between the CCD camera and the workpiece, a line sensor for picking-up the image of the workpiece by one line, and a contrast arithmetic means (circuit) for calculating a contrast from the image picked up by this line sensor. The line sensor is arranged in a position in which the optical distance between the line sensor and the workpiece is equal to the optical distance between the CCD camera and the workpiece.
In the focus detecting method described in JP-A-8-226805, while the optical distances between the workpiece, the CCD camera and the line sensor are adjusted by the focusing adjusting means, the contrast is calculated in plural distance positions from the image picked up by the line sensor and a position for maximizing the contrast is detected as the focus position. The focus detecting method is constructed such that the image picked up by the CCD camera can be focused by adjusting the optical distance between the CCD camera and the workpiece by the focusing adjusting means on the basis of the detected focus position.